import QtQuick 2.0
import QtQuick.Controls 2.0


Item {
    id: fpsItem
    property real fps: 60.0
    property int count: 0
    Item {
        NumberAnimation on rotation {
            duration: 1000
            from: 0
            to: 360
            loops: -1
            running: true
        }
        onRotationChanged: fpsItem.count++
    }
    Text {
        anchors.centerIn: parent
        text: "FPS " + fpsItem.fps.toFixed(1)
        color: "red"
        font.pointSize: 14
    }
    Timer {
        interval: 1000
        onTriggered: {
            fpsItem.fps = fpsItem.count;
            fpsItem.count = 0;
        }
        repeat: true
        running: true
    }
}
